package cn.tedu.anjiadb.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
public class User implements Serializable {
    private Long                id;
    @NotEmpty
    private String              username;
    @NotEmpty
    private String              password;
    @NotEmpty
    private String              nickname;
    @NotEmpty
    private Long                phoneNum;
    @NotEmpty
    private String              mail;
    private Integer             enable;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date                birth;
    private LocalDateTime       created;
}
